package org.example.struct.array;

import java.util.Arrays;

/**
 * @author liyishan
 * @date 2024/4/23 11:23
 * @apiNote
 */

public class Test00455FindContentChildren {

    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int i = 0, j = 0;
        int ans = 0;
        while (i < g.length && j < s.length) {
            if(s[j] >= g[i]){
                ans++;
                i++;
                j++;
            }else{
                j++;
            }
        }
        return ans;
    }
}
